import * as types from '../constants/ActionTypes'


export function login(username, password) {
  return {
    type: types.LOGIN,
    uname: username,
    pwd: password,
  };
}

export function logining (username, password) {
  return {
    type: types.LOGINING,
    uname: username,
    pwd: password,
  };
}

export function loginSuccess (username, merid) {
  return {
    type: types.LOGINSUCCESS,
    uname: username,
    merid: merid,
  };
}

export function loginFail (errorMessage) {
  return {
    type: types.LOGINFAIL,
    errorMessage: errorMessage,
  }
}

export function resetLogin() {
  return {
    type: 'clear',
  }
}